/**
 * @version 2007-5-16
 * @author xalinx at gmail dot com
 */
package org.nanhill.commons.dbutil.pagequery;

import java.io.Serializable;

/**
 * @version 2007-5-16
 * @author xalinx at gmail dot com
 * 
 */
public abstract class PageQuery implements Serializable {

	private int start = 0;

	private int pageSize = 20;

	private boolean count = false;

	public boolean isCount() {
		return count;
	}

	public void setCount(boolean count) {
		this.count = count;
	}

	public int getPageSize() {
		return pageSize;
	}

	public void setPageSize(int maxResults) {
		if (maxResults <= 0) {
			throw new IllegalArgumentException();
		}
		this.pageSize = maxResults;
	}

	public int getStart() {
		return start;
	}

	public void setStart(int firstResult) {
		if (firstResult < 0) {
			throw new IllegalArgumentException();
		}
		this.start = firstResult;
	}

}
